package com.xyp.demo.web;

import com.xyp.comm.model.Response;
import com.xyp.demo.model.City;
import com.xyp.demo.service.ICityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xyp
 * @date 2019-11-05 10:39
 * @description
 * @version: 1.0
 */
@RestController
@RequestMapping(value = "/city")
public class CityController {
    @Autowired
    private ICityService cityService;
    @RequestMapping(value = "getByName")
    public Response<City> getCityByName(String name){
        return new Response<>(cityService.getCityByName(name));
    }
}
